package com.rxmvp.rxmvpdemo.RxRetrofit.subscriber;

import com.rxmvp.rxmvpdemo.RxRetrofit.Response.BaseResponse;
import com.rxmvp.rxmvpdemo.RxRetrofit.Response.ResponseUtil;

/**
 * 作者： huangRZ on 2017/1/21. 15:04
 * 邮箱：917647409@qq.com
 */
public abstract class ResponseSubscriber<T> extends BaseSubscriber<BaseResponse<T>> {

    @Override
    public void onNext(BaseResponse<T> response) {


        if (ResponseUtil.IsNormal(response)) {
            onSuccess(response);
        }
    }

    public abstract void onSuccess(BaseResponse<T> response);

}
